# -*- coding: UTF-8 -*- #
veg = 14730
fru = 8290
meat = 5710
day = 13340
cloth = 12450
travel = 9800
suili = 9800

import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif']='SimHei'#设置中文显示
plt.figure(figsize=(6,6))#将画布设定为正方形，则绘制的饼图是正圆
label=['蔬菜','水果','肉类','日常开销','衣服','旅游','随礼']#定义饼图的标签，标签是列表
explode=[0.01,0.01,0.01,0.01,0.01,0.01,0.01]#设定各项距离圆心n个半径
#plt.pie(values[-1,3:6],explode=explode,labels=label,autopct='%1.1f%%')#绘制饼图
values=[14730,8290,5710,13340,12450,9800,9800]
plt.pie(values,explode=explode,labels=label,autopct='%1.1f%%')#绘制饼图
plt.title('饼图')#绘制标题
plt.savefig('./饼图')#保存图片
plt.show()